<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>login</title>
    <link rel="stylesheet" href="../css/header.css"/>
    <link rel="stylesheet" href="../css/footer.css"/>
    <link rel="stylesheet" href="../css/login.css"/>
    <script src="../js/angular.min.js"></script>
</head>
<body>
    <!-- 页头容器-->
    <?php 
    include 'header1.php';
     ?>
    <!-- 内容容器-->
    <div class="content">
        <p class="place">您当前的位置：首页 > 会员登录</p>
        <div class="c_login" style="overflow: hidden">
            <div class="left">
                <div class="mc">
                    <a href="#">会员中心</a>
                </div>
                <div class="ml">
                    <a href="#">会员登陆</a>
                </div>
                <div class="ml">
                    <a href="#">会员注册</a>
                </div>
            </div>
            <div class="right">
                <form action="login.php" method="post" ng-app="myApp" ng-controller="validateCtrl" 
                id="myForm" name="myForm" novalidate>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="name">会 员 名：</td>
                                <td class="frame">
                                    <input type="text" name="vname" method="post" size="30"  ng-model="vname" required/>
                                    <span style="color:red" ng-show="myForm.vname.$dirty && myForm.vname.$invalid">
                                        <span ng-show="myForm.vname.$error.required">*会员名不能为空</span>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="name">登陆密码：</td>
                                <td class="frame">
                                    <input type="password" name="vpwd" method="post" size="30"  ng-model="vpwd" ng-minlength="6"
                                    ng-maxlength="20" required/>
                                    <span style="color: red" ng-show="myForm.vpwd.$dirty && myForm.vpwd.$invalid">
                                        <span ng-show="myForm.vpwd.$error.required">*密码不能为空</span>
                                        <span ng-show="myForm.vpwd.$error.minlength">*密码长度不小于6</span>
                                        <span ng-show="myForm.vpwd.$error.maxlength">*密码长度不超过20</span>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="name">验 证 码：</td>
                                <td class="frame">
                                    <input type="text" size="10"/>
                                    <img src="../images/login/yzm.bmp" style="vertical-align: middle" alt=""/>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 50px"></td>
                                <td>
                                    <input type="button" class="sub" ng-click="submit(myForm.$valid)"
                                    value="登陆"ng-disabled="myForm.vname.$dirty && myForm.vname.$invalid || myForm.vpwd.$dirty && myForm.vpwd.$invalid"/>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>

    </div>
    <!-- 页尾容器-->
    <?php include 'footer1.php' ?>

    <script src="../js/jquery-3.1.1.js"></script>

    <script>
        var app = angular.module('myApp', []);
        app.controller('validateCtrl', function($scope) {
            $scope.vname = '';
            $scope.password = '';

            $scope.submit=function (isValid) {
                if (isValid) {
                    myForm.submit();
                };
            }
           });
        
    </script>
</body>
</html>